package com.swanclouds.redfish.managers.domain;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.swanclouds.model.managers.Diagnostic;

import java.util.List;
import java.util.Map;

/**
 * @author 李文强
 * description
 */

public class DiagnosticServiceModel implements Diagnostic {

    //诊断服务资源的节点的访问路径
    @JsonProperty("@odata.id")
    private String dataId;

    //诊断服务资源的类型的OData描述信息
    @JsonProperty("@odata.context")
    private String context;

    //诊断服务资源的类型
    @JsonProperty("@odata.type")
    private String type;

    //诊断服务资源的ID
    @JsonProperty("Id")
    private String id;

    //诊断服务资源的名称
    @JsonProperty("Name")
    private String name;

    //截屏功能使能状态
    @JsonProperty("ScreenShotEnabled")
    private Boolean  screenShotEnabled;

    //黑匣子功能使能状态
    @JsonProperty("BlackBoxEnabled")
    private Boolean blackBoxEnabled;

    //触发截屏时间
    @JsonProperty("ScreenShotCreateTime")
    private List<String> screenShotCreateTime;

    //诊断服务支持的Action操作
    @JsonProperty("Actions")
    private Map<String,Object> actions;
    //触发截屏操作的描述
    @JsonProperty("description")
    private String Description;
   //触发截屏操作的运行结果
   @JsonProperty("result")
    private String Result;

    public void setDataId(String dataId) {
        this.dataId = dataId;
    }

    public void setContext(String context) {
        this.context = context;
    }

    public void setType(String type) {
        this.type = type;
    }

    public void setId(String id) {
        this.id = id;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Boolean getScreenShotEnabled() {
        return screenShotEnabled;
    }

    public void setScreenShotEnabled(Boolean screenShotEnabled) {
        this.screenShotEnabled = screenShotEnabled;
    }

    public Boolean getBlackBoxEnabled() {
        return blackBoxEnabled;
    }

    public void setBlackBoxEnabled(Boolean blackBoxEnabled) {
        this.blackBoxEnabled = blackBoxEnabled;
    }

    public List<String> getScreenShotCreateTime() {
        return screenShotCreateTime;
    }

    public void setScreenShotCreateTime(List<String> screenShotCreateTime) {
        this.screenShotCreateTime = screenShotCreateTime;
    }

    public Map<String, Object> getActions() {
        return actions;
    }

    public void setActions(Map<String, Object> actions) {
        this.actions = actions;
    }

    @Override
    public String getDataId() {
        return dataId;
    }

    @Override
    public String getContext() {
        return context;
    }

    @Override
    public String getType() {
        return type;
    }

    @Override
    public String getId() {
        return id;
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public String toString() {
        ObjectMapper objectMapper = new ObjectMapper();
        try {
            return objectMapper.writeValueAsString(this);
        } catch (JsonProcessingException e) {
        }
        return "DiagnosticServiceModel{" +
                "dataId='" + dataId + '\'' +
                ", context='" + context + '\'' +
                ", type='" + type + '\'' +
                ", id='" + id + '\'' +
                ", name='" + name + '\'' +
                ", screenShotEnabled=" + screenShotEnabled +
                ", blackBoxEnabled=" + blackBoxEnabled +
                ", screenShotCreateTime=" + screenShotCreateTime +
                ", actions=" + actions +
                ", Description='" + Description + '\'' +
                ", Result='" + Result + '\'' +
                '}';
    }
}
